﻿using Foxit.PDF;
using Foxit.PDF.PageElements;

namespace Sustainalytics.ReportGeneratorFramework.FrameworkEntities
{
    public class PdfPage : Page
    {
        public PdfDocument Document { get; set; }
        public int PageNumber { get; set; }

        public PdfPage(PdfDocument document)
        {
            Dimensions = new PageDimensions(document.PageSize, document.PageOrientation, document.PageMargins);

            if (document.ShowLayoutGrid)
                Elements.Add(new LayoutGrid { ShowTitle = false });

            Document = document;
        }

        public void AddElement(PageElement element)
        {
            Elements.Add(element);
        }

        public void AddBookmark(string bookmarkName, float verticalPosition, Outline outline)
        {
            Elements.Add(new Bookmark(bookmarkName, Document.LeftMargin, verticalPosition, outline));
        }
    }
}
